<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
            #box1{
                width: 600px;
                height: 400px;
                background-color: yellow;
            }
            .item{
                background-color: red;
                width: 100px;
                height: 50px;
                margin-top: 10px;
                margin-left: 10px;
                float: left;
                /* 改成浮动 */
                padding-left: 10px;
            }
    </style>
</head>
<body>
    <div id="box1">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
    </div>
    
 
</body>
</html>